package com.ruoyi.yljf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.yljf.domain.Drug;
import com.ruoyi.yljf.domain.DrugNotice;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface DrugNoticeMapper extends CommonNoticeMapper<DrugNotice> {

    @Update("update yljf_drug_notice set likes = likes + 1 where id = #{noticeId}")
    @Override
    Integer like(Long noticeId);

    @Update("update yljf_drug_notice set likes = likes - 1 where id = #{noticeId} and likes > 0")
    @Override
    Integer undoLike(Long noticeId);
}
